package com.tarena.lbs.coupon.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tarena.lbs.base.protocol.pager.PageResult;
import com.tarena.lbs.coupon.pojo.po.UserCouponsPO;
import com.tarena.lbs.coupon.pojo.vo.UserCouponsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserCouponsMapper  extends BaseMapper<UserCouponsPO> {
    @Select("SELECT COUNT(*) FROM user_coupons WHERE user_id=#{userId} AND coupon_id=#{couponId}")
    Integer selectCountById(Integer couponId, Integer userId);

    UserCouponsVO selectByCode(String couponCode);

}
